package com.chao.sentinel.controller;

import com.chao.sentinel.service.FlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : Rookie
 * @description : 限流 关联
 * @date : 2022/4/6
 */
@RestController
@RequestMapping("/flow")
public class FlowLimitController {

    @Autowired
    private FlowService flowService;

    @GetMapping("/order")
    public String order(){
        return "下单成功！";
    }

    @GetMapping("/pay")
    public String pay() {
        return "支付成功！";
    }

    @GetMapping("/order/query")
    public String orderQuery(@RequestParam String orderId){
        return flowService.query(orderId);
    }
}
